//在主函数内任意输入一个5x6矩阵，编写函数求出每一行的和并放到一个一维数组
//输出矩阵和一维数组

#include <stdio.h>

int summ(int a[5][6],int su[5])
{
	int i,j,s;
	for (i=0;i<5;i++)
	{	
		s=0;
		for (j=0;j<6;j++)
			s+=a[i][j];
		su[i]=s;
	}
	return (su[5]);
}

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main()
{	
	int i,j;
	int a[5][6],su[5];
	 for (i=0;i<5;i++)
        {
                for (j=0;j<6;j++)
                {
                        a[i][j] = rand()%100;
                        printf("%2d ",a[i][j]);
                }
                printf("\n");
        }

        printf("============================\n");

	summ(a,su);
	for (i=0;i<5;i++)
		printf("%d ",su[i]);
	printf("\n");

	return 0 ;
}



//diwutiantang@diwutiantang-VirtualBox:~/snap/lc/Dec/1219/zuoye$ ./9
//83 86 77 15 93 35
//86 92 49 21 62 27
//90 59 63 26 40 26
//72 36 11 68 67 29
//82 30 62 23 67 35
//============================
//389 337 304 283 299

